package ghttp

import "github.com/gin-gonic/gin"

func Success(data any) interface{} {
	return gin.H{
		"code":    0,
		"message": "ok",
		"data":    data,
	}
}

func Fail(code int, msg string) interface{} {
	return gin.H{
		"code":    code,
		"message": msg,
		"data":    nil,
	}
}

func Failed(code int, msg string, data any) interface{} {
	return gin.H{
		"code":    code,
		"message": msg,
		"data":    data,
	}
}
